package org.ns.summer.mvc.mappinghandler;

import org.ns.summer.core.AnnotationUtils;
import org.ns.summer.mvc.anns.ResponseBody;

public class ExecutorResult {
    private Object result;
    private HandlerMethod handlerMethod;
    private ResponseBody responseBody;

    public ExecutorResult(Object result, HandlerMethod handlerMethod) {
        this.result = result;
        this.handlerMethod = handlerMethod;
        this.responseBody = (ResponseBody)AnnotationUtils.getAnnotation(handlerMethod.getMethod(), ResponseBody.class);
    }

    public Object getResult() {
        return result;
    }

    public HandlerMethod getHandlerMethod() {
        return handlerMethod;
    }

    public ResponseBody getResponseBody() {
        return responseBody;
    }
}
